package com.gewu.pm.ui.fragment.clockin;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gewu.pm.R;
import com.gewu.pm.aop.SingleClick;
import com.gewu.pm.app.TitleBarFragment;
import com.gewu.pm.ui.activity.clockin.CcToMeActivity;
import com.gewu.pm.ui.activity.clockin.ClockInManageActivity;
import com.gewu.pm.ui.activity.clockin.MakeUpClockInActivity;
import com.gewu.pm.ui.activity.clockin.MyMakeUpApplyActivity;
import com.gewu.pm.ui.activity.clockin.MyMakeUpApprovalActivity;

/**
 * 审批 Fragment
 */
public final class ApprovalFragment extends TitleBarFragment<ClockInManageActivity>
        implements View.OnClickListener {

    private LinearLayout mMyApplicationLayout;
    private LinearLayout mMyApprovalLayout;
    private LinearLayout mCcToMeLayout;
    private TextView tvMakeupCard;

    public static ApprovalFragment newInstance() {
        return new ApprovalFragment();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.approval_fragment;
    }

    @Override
    protected void initView() {
        mMyApplicationLayout = findViewById(R.id.ll_my_application);
        mMyApprovalLayout = findViewById(R.id.ll_my_approval);
        mCcToMeLayout = findViewById(R.id.ll_cc_to_me);
        tvMakeupCard = findViewById(R.id.tv_makeup_card);

        setOnClickListener(mMyApplicationLayout, mMyApprovalLayout, mCcToMeLayout, tvMakeupCard);
    }

    @Override
    protected void initData() {
        // 加载数据
    }

    @SingleClick
    @Override
    public void onClick(View view) {
        int viewId = view.getId();
        if (viewId == R.id.ll_my_application) {//我的申请
            MyMakeUpApplyActivity.start(getAttachActivity());

        } else if (viewId == R.id.ll_my_approval) {//我的审批
            MyMakeUpApprovalActivity.start(getAttachActivity());

        } else if (viewId == R.id.ll_cc_to_me) {//抄送我的
            CcToMeActivity.start(getAttachActivity());

        } else if (viewId == R.id.tv_makeup_card) {//补卡申请
            MakeUpClockInActivity.start(getAttachActivity());

        }
    }
}
